package 网络编程;
import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;
public class interaddress常用方法 {
    public static void main(String[] args) throws Exception {
        InetAddress localhost = InetAddress.getLocalHost();
        System.out.println(localhost);
       InetAddress 百度=InetAddress.getByName("www.baidu.com");
        System.out.println(百度);
        System.out.println(百度.isReachable(5000));
    }
}
